<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"   
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>	   	
	   	<f:viewParam name="firstResult" value="#{sectorList.firstResult}"></f:viewParam>	
	   	<f:viewParam name="sectorName" value="#{sectorList.parameterValues['sectorName']}"></f:viewParam>
	   	<f:viewParam name="moduleName" value="行业管理"></f:viewParam>
   	</f:metadata>
   
   	<ui:define name="content">
   	   
		<h:form id="searchForm">
	   		<p:panel header="用户查询" style="margin-bottom:10px;">
				<p:messages id="messages" />	
		        
		        <h:panelGrid columns="4" cellpadding="5">
		        	<p:outputLabel for="sectorName" value="行业名称"></p:outputLabel>
					<p:inputText
						id="sectorName"
						value="#{sectorList.parameterValues['sectorName']}"
					></p:inputText>
				</h:panelGrid>
		    	    	
		    	<p:commandButton action="SectorList.xhtml?faces-redirect=true&amp;includeViewParams=true&amp;firstResult=0" ajax="false" value="查询">		    		
		    	</p:commandButton>
			</p:panel>
			
			<p:panel id="searchResult">
				<f:facet name="header">行业管理</f:facet>
				<p:dataTable value="#{sectorList.resultList}" var="_sector">
										
					<p:column>
						<f:facet name="header">行业名称</f:facet>
						<h:outputText value="#{_sector.sectorName}" style="text-indent: #{_sector.level}em; display: block" />						
					</p:column>
					
					<p:column>
						<f:facet name="header">所属行业</f:facet>
						#{_sector.parentSector.sectorName}
					</p:column>
					
					<p:column>
						<f:facet name="header">编号</f:facet>
						#{_sector.sno}
					</p:column>
					
					<p:column style="text-align: center;width:160px;">
						<f:facet name="header">操作</f:facet>
						<p:button value="编辑" outcome="SectorEdit.xhtml">
							<f:param name="sectorId" value="#{_sector.id}"></f:param>
						</p:button>
						
						<p:button value="添加下级" target="_blank" outcome="SectorEdit.xhtml">
							<f:param name="parentSectorId" value="#{_sector.id}"></f:param>
						</p:button>
					</p:column>
				</p:dataTable>
			</p:panel>
			
			<ui:include src="/WEB-INF/templates/manage/pagination.xhtml">
				<ui:param name="entityList" value="#{sectorList}" />
			</ui:include>
			
		</h:form>
		
		<p:button href="SectorEdit.xhtml" value="新增行业名称"></p:button>
      
   	</ui:define>
</ui:composition>
